local rule = fk.CreateSkill {
  name = "#&",
}

rule:addEffect(fk.GameOverJudge, {
  priority = 0.001,
  can_refresh = function(self, event, target, player, data)
    return target == player
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:setTag("SkipGameRule", true)
  end,
})

rule:addEffect(fk.BuryVictim, {
  priority = 0.001,
  can_refresh = function(self, event, target, player, data)
    return target == player
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room

    --击杀奖惩
    if data.killer then
      if data.killer.dead then return end
      if player.role == "rebel" then
        data.killer:drawCards(3, "kill")
      elseif player.role == "loyalist" then
        data.killer:throwAllCards("he")
      end
    end
  end,
})

rule:addEffect(fk.Deathed, {
  priority = 0.001,
  can_refresh = function(self, event, target, player, data)
    return target == player
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room

    --胜利判定
    local winner = Fk.game_modes[room.settings.gameMode]:getWinner(player)
    if winner then
      room:gameOver(winner)
    end
  end,
})








return rule
